<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件练习</title>
    <script>
        let arr = ["来抓我呀","抓不到我吧","气不气","气死你","急死你"];
        let index = 1;
        function f1(){
            let btn = document.getElementById("btn");
            btn.style.left = Math.random()*1700+"px";
            btn.style.top = Math.random()*800+"px";
            btn.value = arr[index++ % arr.length];
        }
    </script>
</head>
<body>
<!--
    浏览器中存在一个按钮
    当用户将鼠标移动到该按钮上
    这个按钮会立刻跑路,会出现在浏览中随机的某个位置上
    且按钮的内容会发生改变
    内容依次变为:来抓我呀、抓不到我吧、气不气、气死你、急死你...
    这些内容循环改变
-->
<input type="button" id="btn" value="来抓我呀" style="position: relative;left: 100px;top: 100px;" onmouseover="f1()">
<!--<div style="background: red;width: 1700px;height: 800px;"></div>-->
</body>
</html>